<?php
session_start();
echo SumTotal($_SESSION['ORDER_DETAIL']);

function SumTotal($array)
{
	$total = 0;
	$item = 0;
	$list = 0;
	if (is_array($array))
	{
		$list = count($array);
		foreach ($array AS $rowNum => $row)
		{
			$total = $total + str_replace(",","",$row['AMOUNT']);
			$item = $item + str_replace(",","",$row['QTY']);
		}
		return number_format($total,2)."|".number_format($item)."|".$list;			
	}
	return "";
}
?>